import router from "./index";
import store from "@/store";
//导航全局前置守卫
router.beforeEach((to, from, next) => {
//   console.log("导航全局前置守卫---to----", to);

  if (to.path === 'login') return next()
  // 获取token值, 如果token值不存在直接返回登录页面
  const tokenStr = window.sessionStorage.getItem('tokenStr')
  if (!tokenStr && to.path !== '/login') return next('/login')
  // 如果存在直接放行
  next()

});
